package com.zhouyu.controller;

import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.util.NestedServletException;



@ControllerAdvice
public class ExceptionController {

	@ExceptionHandler
	public ResponseEntity<String> handle1( Exception e){
		return ResponseEntity.status(HttpStatus.BAD_REQUEST)
				.body(e.getMessage());

	}
}
